From: Oleksandr Dmytryshyn Date: Wed, 27 Nov 2013 17:09:52 +0000 (+0200) Subject: xen: arm: flush dcache while preparing the device tree for Dom0 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5838 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=c8f14de363587a0143e5d4181cca44979f4baa98;p=xen.git xen: arm: flush dcache while preparing the device tree for Dom0 Without flushing dcache the hypervisor couldn't copy the device tree correctly when booting the kernel dom0 Image (memory with device tree is corrupted). As the result - when we try to load the kernel dom0 Image - dom0 hungs frequently. This issue is not reproduced with the kernel dom0 zImage because the zImage decompressor code flushes all dcache before starting the decompressed kernel Image. When the hypervisor loads the kernel image or initrd, this memory region isn't corrupted because the hypervisor code flushes the dcache. Signed-off-by: Oleksandr Dmytryshyn Acked-by: Ian Campbell Acked-by: Julien Grall --- diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index e9bb01fa2d..99e785aaaa 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -906,7 +906,8 @@ static void dtb_load(struct kernel_info *kinfo) printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n", kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt)); - rc = raw_copy_to_guest(dtb_virt, kinfo->fdt, fdt_totalsize(kinfo->fdt)); + rc = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt, + fdt_totalsize(kinfo->fdt)); if ( rc != 0 ) panic("Unable to copy the DTB to dom0 memory (rc = %lu)\n", rc); xfree(kinfo->fdt);